package com.redis.base.redis;

import javax.annotation.Resource;

import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Service;

import com.redis.base.config.RedisParamConfig;

@Service("redisTools")
public class RedisTools extends RedisImpl implements IRedis {
	
	@Resource(name ="redisParamConfig")
	private RedisParamConfig redisConfig;

	@Resource(name = "redisTemplate")
	protected RedisTemplate<String, String> redisTemplate;

	@Override
	public RedisTemplate<String, String> redisTemplate() {
		return redisTemplate;
	}


	@Override
	public int getSpinNum() {
		return redisConfig.getSpinNum();
	}

	@Override
	public Long getExpire() {
		return redisConfig.getExpire();
	}

	@Override
	public boolean isEnable() {
		return redisConfig.isEnable();
	}

	@Override
	public int getSpinThreadTime() {
		return redisConfig.getSpinThreadTime();
	}

	@Override
	public boolean isSpin() {
		return redisConfig.isSpin();
	}

	@Override
	public int getLockExpire() {
		return redisConfig.getLockExpire();
	}


	public RedisTemplate<String, String> getRedisTemplate() {
		return redisTemplate;
	}


	public void setRedisTemplate(RedisTemplate<String, String> redisTemplate) {
		this.redisTemplate = redisTemplate;
	}

}
